package com.atguigu.yygh.hosp.repository;

import com.atguigu.yygh.model.hosp.Department;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.stereotype.Repository;

import java.util.List;


//第一个参数是实体类类型,第二个参数是实体类的主键类型
@Repository
public interface DepartmentRepository extends MongoRepository<Department,String> {
    Department findByHoscodeAndDepcode(String hoscode,String depcode);

    /**
     * Department findByHoscodeEqualsAndDepcodeEquals(String hoscode,String depcode);
     * k=v and k2=v2 (如果是大于,小于...不可以省略)
     */

    void removeByHoscodeAndDepcode(String hoscode,String depcode);

    //根据医院编号查询小科室
    List<Department> findByHoscode(String hoscode);
}
